Developer(s) | Apache Software Foundation |
---|---|
Stable release | 1.7 / November 29, 2010 |
Development status | Active |
Written in | Java |
Operating system | Cross-platform |
Type | template engine |
License | Apache License 2.0 |
Website | http://velocity.apache.org/ |
Apache Velocity (formerly known as Jakarta Velocity) is an open source software project directed by the Apache Software Foundation. Velocity is a Java-based template engine that provides a simple yet powerful template language to reference objects defined in Java code. Its aim is to ensure clean separation between the presentation tier and business tiers in a Web application (the model–view–controller design pattern).
Velocity is not widely used. Most developers seeking a product for this task are more likely to use the far better-known XSLT. One of the few places where Velocity is used is as part of Apache's Torque project, a tool for single-source publishing of database objects and schemas across different database platforms. Single XML and DTD documents are written to describe the database, then a suite of different Velocity templates for each target database are used to expand these into the necessary SQL statemnts.
Contents |
Some common types of applications that use Velocity are:
The following template:
## Velocity Hello World <html> <body> #set( $foo = "Velocity" ) ## followed by Hello $foo World! </body> </html>
processed by Velocity will produce the following text:
<html> <body> Hello Velocity World! </body> </html>
The syntax and overall concept of the Apache Velocity templates is very similar to the syntax of the older WebMacro template engine which is now also an open source project.
|